<?php
	include("../../include/dbconnect.php");
	$id="";
	if(isset($_POST["id"]) && $_POST["id"]!="") $id=$_POST["id"];
	$target="";
	if(isset($_POST["target"]) && $_POST["target"]!="") $target=$_POST["target"];
	
	$table="chungloai";
	session_start();
	header('Content-type: application/json; charset=utf-8');
	if(!isset($_SESSION["un"])) $_SESSION["un"]="";
	if($_SESSION["un"]!="")
	{
		if($id=="") die("{\"status\":0}");
		if($target=="0") $target="null";
		mysql_query("update $table set idchungloai=$target where id=$id",$conn) or die("{\"status\":0}");
		echo "{\"status\":1}";
	}
	else echo "{\"status\":0}";
	
	include("../../include/dbclose.php");
?>
